home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / Make / source / job.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-22  |  2.6 KB  |  82 lines

  1. /* Definitions for managing subprocesses in GNU Make.
  2. Copyright (C) 1992, 1993, 1996 Free Software Foundation, Inc.
  3. This file is part of GNU Make.
  4.  
  5. GNU Make is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. GNU Make is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with GNU Make; see the file COPYING.  If not, write to
  17. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #ifndef SEEN_JOB_H
  20. #define SEEN_JOB_H
  21.  
  22. /* Structure describing a running or dead child process.  */
  23.  
  24. struct child
  25.   {
  26.     struct child *next;        /* Link in the chain.  */
  27.  
  28.     struct file *file;        /* File being remade.  */
  29.  
  30.     char **environment;        /* Environment for commands.  */
  31.  
  32.     char **command_lines;    /* Array of variable-expanded cmd lines.  */
  33.     unsigned int command_line;    /* Index into above.  */
  34.     char *command_ptr;        /* Ptr into command_lines[command_line].  */
  35.  
  36.     pid_t pid;            /* Child process's ID number.  */
  37. #ifdef VMS
  38.     int efn;            /* Completion event flag number */
  39.     int cstatus;        /* Completion status */
  40. #endif
  41.     unsigned int remote:1;    /* Nonzero if executing remotely.  */
  42.  
  43.     unsigned int noerror:1;    /* Nonzero if commands contained a `-'.  */
  44.  
  45.     unsigned int good_stdin:1;    /* Nonzero if this child has a good stdin.  */
  46.     unsigned int deleted:1;    /* Nonzero if targets have been deleted.  */
  47.   };
  48.  
  49. extern struct child *children;
  50.  
  51. extern void new_job PARAMS ((struct file *file));
  52. extern void reap_children PARAMS ((int block, int err));
  53. extern void start_waiting_jobs PARAMS ((void));
  54.  
  55. extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file));
  56. #ifdef VMS
  57. extern int child_execute_job PARAMS ((char *argv, struct child *child));
  58. #else
  59. extern void child_execute_job PARAMS ((int stdin_fd, int stdout_fd, char **argv, char **envp));
  60. #endif
  61. #ifdef _AMIGA
  62. extern void exec_command PARAMS ((char **argv));
  63. #else
  64. extern void exec_command PARAMS ((char **argv, char **envp));
  65. #endif
  66.  
  67. extern unsigned int job_slots_used;
  68.  
  69. extern void block_sigs PARAMS ((void));
  70. #ifdef POSIX
  71. extern void unblock_sigs PARAMS ((void));
  72. #else
  73. #ifdef    HAVE_SIGSETMASK
  74. extern int fatal_signal_mask;
  75. #define    unblock_sigs()    sigsetmask (0)
  76. #else
  77. #define    unblock_sigs()
  78. #endif
  79. #endif
  80.  
  81. #endif /* SEEN_JOB_H */
  82.